This invention relates to data processing systems generally and particularly to perform a floating point division operation on a data processing system.
Floating point division operations often begin computing a quotient in a computer by generating an estimate of the reciprocal of the divisor first. Then the estimate of the reciprocal is further refined, or in other words, the precision of the estimate""s mantissa is increased to exceed a threshold value, before the estimated reciprocal is applied to produce the quotient.
The Institute of Electrical and Electronic Engineers (IEEE) provides a standard for floating point arithmetic and correct results. This standard is entitled xe2x80x9cAn American National Standardxe2x80x94IEEE Standard For Binary Floating-Point Arithmeticxe2x80x9d, ANSI/IEEE std. 754-1985 (hereinafter IEEE 754 standard). One prior art approach, described in Cocanougher et al., U.S. Pat. No. 5,249,149 (hereinafter Cocanougher), discloses a method of performing a floating point division conforming to this IEEE 754 standard.
Specifically, the prior art approach obtains a correctly rounded-to-nearest quotient with two prerequisite conditions. The conditions are: 1) the reciprocal of the divisor is correctly rounded, except for one special case; and 2) the initial estimated quotient is known to be within 1 unit-in-the-last-place (ulp) of the correct quotient. The following further illustrates this prior art approach by mathematical equations:
Equation 1: |qxe2x80x2xe2x88x92a/b| less than =1 ulp of a/b, where a/b represents xe2x80x9cthe correct quotientxe2x80x9d, and qxe2x80x2 represents xe2x80x9cthe initial estimated quotientxe2x80x9d
Equation 2: yxe2x80x2=rounded (1/b), where 1/b represents xe2x80x9cthe true reciprocal of the divisorxe2x80x9d, and yxe2x80x2 represents a rounded value of (1/b).
Equation 3: when yxe2x80x2 is correctly rounded (except for one special case), then qfinalxe2x80x2 (or xe2x80x9ccorrectly rounded-to-nearest quotientxe2x80x9d) can be obtained by performing the following:
rxe2x80x2=rounded (axe2x88x92b*qxe2x80x2)
qfinalxe2x80x2=rounded (qxe2x80x2+rxe2x80x2*yxe2x80x2)
Although this prior art approach provides one method of performing floating point division and producing a correctly rounded quotient, satisfying the two required conditions described above can be difficult. Specifically, obtaining a correctly rounded yxe2x80x2 often demands iterations of calculating an error parameter and a yxe2x80x2 value associated with the error parameter. These iterations consume clock cycles and as a result negatively impact the overall performance of a floating point division operation.
Therefore, a method and apparatus is needed to further speed up the process of obtaining a correctly rounded quotient.
A method and apparatus for performing a floating point division of a dividend (a) by a divisor (b) to produce a correctly rounded-to-nearest quotient (qxe2x80x2) having a mantissa of P bits in a data processing system is disclosed.
In one embodiment, the data processing system computes a current quotient estimate (qmxe2x80x2, where m represents an integer and m greater than =0) that is within 1 ulp of a true quotient (a/b). Then the data processing system computes a current remainder estimate (rmxe2x80x2) based on the dividend (a), the divisor (b) and the current quotient estimate (qmxe2x80x2). The data processing system also computes a current reciprocal estimate (ynxe2x80x2, where n represents an integer and n greater than =0) based on a reciprocal intermediate value (E) with a relative error with respect to a true reciprocal of the divisor (1/b) of less than or equal to z/(22P) (where z is an integer derived from error analyses of computations of the current reciprocal estimate (ynxe2x80x2)).
Finally, the data processing system obtains the correctly rounded-to-nearest quotient (qxe2x80x2), except possibly when z greater than =(2Pxe2x88x92Mb) (where Mb represents mantissa of the divisor, b), based on the current remainder estimate (rmxe2x80x2), the current reciprocal estimate (ynxe2x80x2) and current quotient estimate (qmxe2x80x2).